<!DOCTYPE HTML>
<html lang="en">
<head>
<title>#CommentFlag - Syntax &amp; Usage | AutoHotkey</title>
<meta name="description" content="The #CommentFlag directive changes the script's comment symbol from semicolon to some other string." />
<meta name="ahk:equiv-v2" content="AutoHotkey.htm" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>#CommentFlag</h1>

<p>Changes the script's comment symbol from semicolon to some other string.</p>
<p class="note"><strong>Note:</strong> This directive is not recommended for use in new scripts because a) it does more harm than good and b) it is no longer available in <a href="https://www.autohotkey.com/v2/">AutoHotkey v2</a>.</p>

<pre class="Syntax"><span class="func">#CommentFlag</span> NewString</pre>
<h2>Parameters</h2>
<dl>

  <dt>NewString</dt>
  <dd><p>One or more characters that should be used as the new comment flag. Up to 15 characters may be specified.</p></dd>

</dl>
<h2>Remarks</h2>
<p>The default comment flag is semicolon (;).</p>
<p>The comment flag is used to indicate that text that follows it should not be acted upon by the script (comments are not loaded into memory when a script is launched, so they do not affect performance).</p>
<p>A comment flag that appears on the same line as a command is not considered to mark a comment unless it has at least one space or tab to its left. For example:</p>
<pre>MsgBox, Test1 <em>; This is a comment.</em>
MsgBox, Test2; This is not a comment and will be displayed by MsgBox.</pre>
<h2>Related</h2>
<p><a href="_EscapeChar.htm">#EscapeChar</a></p>
<h2>Examples</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>#CommentFlag //  <em>; Change to C++ comment style.</em></pre>
</div>

</body>
</html>
